public class Test {
    /*
    第 N 个泰波那契数
    class Solution {
    public int tribonacci(int n) {
        int[] ret = new int[n + 1];
        ret[0] = 0;
        if (n == 0) {
            return ret[0];
        }
        ret[1] = 1;
        if (n == 1) {
            return ret[1];
        }
        ret[2] = 1;
        if (n == 2) {
            return ret[2];
        }
        for (int i = 3; i <= n; i++) {
            ret[i] = ret[i - 3] + ret[i - 2] + ret[i - 1];
        }
        return ret[n];
    }
}
三步问题
class Solution {
    public int waysToStep(int n) {
        int[] dp = new int[n+1];
        dp[0] = 0;
        dp[1] = 1;
        if(n == 1) {
            return 1;
        }
        dp[2] = 2;
        if(n == 2) {
            return 2;
        }
        dp[3] = 4;
        if(n == 3) {
            return 4;
        }
        for(int i = 4 ; i <= n ;i++) {
           dp[i] = (dp[i-1] + (dp[i-2] + dp[i-3]) % 1000000007) % 1000000007;
        }
        return dp[n];
    }
}
     */

}
